import React from 'react';
import LottieView from 'lottie-react-native';
import { View,StyleSheet,Text, Animated, Easing } from "react-native";

export default class Loading extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            progress: new Animated.Value(0),
        };
    }

    componentDidMount() {
        Animated.timing(this.state.progress, {
            toValue: 1,
            duration: 1000,
            easing: Easing.linear,
        }).start();

    }


    render() {
        return (
                <View style={ styles.container }>
                    <LottieView
                        style={{height:150,width:150}}
                        autoPlay={true}
                        progress={this.state.progress}
                        source={require('../../res/Animate/biking_is_cool')}
                    />
                    <Text>加载中...</Text>
                </View>
        );
    }
}

const styles = StyleSheet.create({
   container:{
       flex:1,
       justifyContent: 'center',
       alignItems: 'center',
   }
});